import {Injectable} from '@angular/core';
import {Observable} from "rxjs/Observable";
import {MsgResult} from "../../../models/msg-result";
import {RequestUtil} from "../../../util/request-util";
import {API} from "../../../constants/constants";

@Injectable()
export class OperService {

  constructor(private requestUtil: RequestUtil) {
  }


  /**
   * 根据id获取单条日志的详情
   * @param {string} id
   * @returns {Observable<MsgResult>}
   */
  getOperLogById(id: string): Observable<MsgResult> {
    return this.requestUtil.get(API.getOperLogById+"/"+id+"?format=json");
  }

  /**
   * 操作日志的批量删除
   * @param operIdArr
   * @returns {Observable<MsgResult>}
   */
  deleteOperLogs(operIdArr): Observable<MsgResult> {
    let patams = "operIdArr="+operIdArr;
    return this.requestUtil.post(API.deleteOperLogs,patams);
  }


}
